package com.heima.feigns;

import com.heima.config.HeimaFeignAutoConfiguration;
import com.heima.feigns.fallback.ApUserFeignFallback;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(
        value = "leadnews-user",
        fallbackFactory = ApUserFeignFallback.class,
        configuration = HeimaFeignAutoConfiguration.class
)
public interface ApUserFeign {
    @ApiOperation("根据id查询apUser信息")
    @GetMapping("/api/v1/user/{id}")
    public ResponseResult<ApUser> findUserById(@PathVariable("id") Integer id);
}
